<h1>GetUrl2</h1>

<p>The GetUrl2 action is used to either load a web page or movie clip or load or submit 
variable values to/from a server. It extends the functionality provided by the GetUrl 
action by allowing the variables defined in a movie to be submitted as form values to a server. Variables defined in a movie can also be initialised by loading a file containing variable name / value assignments.</p>

<table>

<tr>
<th nowrap>Field Name</th>
<th>Type</th>
<th>Description</th>
</tr>

<tr>
<td nowrap valign="top"><a name="ActionType">Type</a></td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">8</td>
<td>Identifies the action when it is encoded.</td>
</tr>

<tr>
<td nowrap valign="top"><a name="ActionLength">Length</a></td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">16</td>
<td>The number of bytes in the rest of the encoded action. The total number of
bytes in the encoded action is Length+3.</td>
</tr>

<tr>
<td nowrap valign="top">requestType</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">8</td>
<td>The type of request generated by the action.</td>
</tr>
</table>

<p>GetUrl2 is a stack-based action, however the type of request being submitted to the server is defined by the requestType attribute. Two arguments, <i>url</i> and <i>target/level</i> are popped from the stack. The <i>url</i> is the first argument popped from the stack and is a fully qualified uniform resource location where the movie clip or web page will be retrieved from. The second argument is either a <i>target</i> - the name of a specific movie clip, e.g. _root.movieClip or the name of a level in the main movie into which a movie clip has been loaded, e.g. _level1.</p>

<p><b>Request Types</b><br/>
The <i>request type</i> is specified as an attribute of the GetUrl2 action. Whether a new web page, movie clip or variable values are loaded is specified by the following types of request:</p>

<table>
<tr><th align="left">Type of Request</th><th align="left">Description</th></tr>

<tr><td>MovieToLevel</td><td>Load a movie to the specified level.</td></tr>
<tr><td>MovieToLevelWithGet</td><td>Load a movie submitting the movie variables using the HTTP GET method.</td></tr>
<tr><td>MovieToLevelWithPost</td><td>Load a movie submitting the movie variables using the HTTP POST method.</td></tr>

<tr><td>MovieToTarget</td><td>Load a new Flash movie or web page to the specified target.</td></tr>
<tr><td>MovieToTargetWithGet</td><td>Load a new Flash movie or web page to the specified target, submitting the movie variables using the HTTP GET method.</td></tr>
<tr><td>MovieToTargetWithPost</td><td>Load a new Flash movie or web page to the specified target, submitting the movie variables using the HTTP POST method.</td></tr>

<tr><td>VariablesToLevel</td><td>Load values for selected movie variables to the specified level.</td></tr>
<tr><td>VariablesToLevelWithGet</td><td>Load values for selected movie variables to the specified level, submitting the movie variables using the HTTP GET method.</td></tr>
<tr><td>VariablesToLevelWithPost</td><td>Load values for selected movie variables to the specified level, submitting the movie variables using the HTTP POST method.</td></tr>

<tr><td>VariablesToTarget</td><td>Load values for selected movie variables to the specified level.</td></tr>
<tr><td>VariablesToTargetWithGet</td><td>Load values for selected movie variables to the specified target, submitting the movie variables using the HTTP GET method.</td></tr>
<tr><td>VariablesToTargetWithPost</td><td>Load values for selected movie variables to the specified target, submitting the movie variables using the HTTP POST method.</td></tr>
</table>

<p>When variables are submitted they are encoded using standard x-www-urlencoded encoding.</p>

<p><b>Targets</b><br/>
The <i>target</i> can either be the name of the frame can be one of the following reserved words:</p>

<div style="padding-left:20px; margin-bottom:10px;">
<ul>
<li><code>"name"</code> opens the new page in the frame with the name defined in the HTML &lt;frame&gt; tag.</li>
<li><code>_blank</code> opens the new page in a new window.</li>
<li><code>_self</code> opens the new page in the current window.</li>
<li><code>_top</code> opens the new page in the top level frame of the current window.</li>
<li><code>_parent</code> opens the new page in the parent frame of the frame where the Flash Player id displayed.</li>
<li><code>""</code> (blank string) opens the new page in the current frame or window.</li>
</ul>
</div>

<p><b>Levels</b><br/>
Levels are virtual layers (analogous to the layers in the Display List). Higher levels are displayed in front of lower levels. The background of each level is transparent allowing movie clips on lower levels to be visible in areas not filled by the movie clip on a given level. The main movie is loaded into level 0. Movie clips are loaded into any level above this (1, 2, 124, etc.). If a movie clip is loaded into a level that already contains a movie clip then the existing clip is replaced by the new one. The level follows the general form: "_level<i>n</i>" loads a movie clip into the current movie at level <i>n</i>.</p>

<h2>History</h2>

<p>GetUrl2 represents the ActionGetUrl2 action of the Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 4.</p>
